home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 June / CHIP 2006-06.2.iso / program / driver / 6-4_xp-2k_dd_cc.exe / Data1.cab / _F5352A7DE63749039FB04B227CD8E34D < prev    next >
Encoding:
Text File  |  2003-09-15  |  42.3 KB  |  1,494 lines

  1. // Copyright (c) 2000-2003 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHIndex_Object()
  5. {
  6.   this.mbPanelInitialized  = false;
  7.   this.mPanelAnchor        = null;
  8.   this.mPanelTabTitle      = WWHFrame.WWHJavaScript.mMessages.mTabsIndexLabel;
  9.   this.mPanelTabIndex      = -1;
  10.   this.mPanelFilename      = "panelfsi.htm";
  11.   this.mInitIndex          = 0;
  12.   this.mOptions            = new WWHIndexOptions_Object();
  13.   this.mTopEntry           = new WWHIndexEntry_Object(false, -1, null);
  14.   this.mMaxLevel           = 0;
  15.   this.mEntryCount         = 0;
  16.   this.mSeeAlsoArray       = new Array();
  17.   this.mSectionIndex       = 0;
  18.   this.mbThresholdExceeded = null;
  19.   this.mSectionCache       = new WWHSectionCache_Object();
  20.   this.mIterator           = new WWHIndexIterator_Object();
  21.   this.mHTMLSegment        = new WWHStringBuffer_Object();
  22.   this.mEventString        = WWHPopup_EventString();
  23.   this.mClickedEntry       = null;
  24.  
  25.   this.fInitHeadHTML          = WWHIndex_InitHeadHTML;
  26.   this.fInitBodyHTML          = WWHIndex_InitBodyHTML;
  27.   this.fInitLoadBookIndex     = WWHIndex_InitLoadBookIndex;
  28.   this.fAddSeeAlsoEntry       = WWHIndex_AddSeeAlsoEntry;
  29.   this.fProcessSeeAlsoEntries = WWHIndex_ProcessSeeAlsoEntries;
  30.   this.fNavigationHeadHTML    = WWHIndex_NavigationHeadHTML;
  31.   this.fNavigationBodyHTML    = WWHIndex_NavigationBodyHTML;
  32.   this.fHeadHTML              = WWHIndex_HeadHTML;
  33.   this.fStartHTMLSegments     = WWHIndex_StartHTMLSegments;
  34.   this.fAdvanceHTMLSegment    = WWHIndex_AdvanceHTMLSegment;
  35.   this.fGetHTMLSegment        = WWHIndex_GetHTMLSegment;
  36.   this.fEndHTMLSegments       = WWHIndex_EndHTMLSegments;
  37.   this.fPanelNavigationLoaded = WWHIndex_PanelNavigationLoaded;
  38.   this.fPanelViewLoaded       = WWHIndex_PanelViewLoaded;
  39.   this.fHoverTextTranslate    = WWHIndex_HoverTextTranslate;
  40.   this.fHoverTextFormat       = WWHIndex_HoverTextFormat;
  41.   this.fGetPopupAction        = WWHIndex_GetPopupAction;
  42.   this.fThresholdExceeded     = WWHIndex_ThresholdExceeded;
  43.   this.fGetSectionNavigation  = WWHIndex_GetSectionNavigation;
  44.   this.fDisplaySection        = WWHIndex_DisplaySection;
  45.   this.fSelectionListHeadHTML = WWHIndex_SelectionListHeadHTML;
  46.   this.fSelectionListBodyHTML = WWHIndex_SelectionListBodyHTML;
  47.   this.fSelectionListLoaded   = WWHIndex_SelectionListLoaded;
  48.   this.fDisplayLink           = WWHIndex_DisplayLink;
  49.   this.fGetEntry              = WWHIndex_GetEntry;
  50.   this.fClickedEntry          = WWHIndex_ClickedEntry;
  51.   this.fClickedSeeAlsoEntry   = WWHIndex_ClickedSeeAlsoEntry;
  52.  
  53.   // Set options
  54.   //
  55.   WWHJavaScriptSettings_Index_DisplayOptions(this.mOptions);
  56. }
  57.  
  58. function  WWHIndex_InitHeadHTML()
  59. {
  60.   var  InitHeadHTML = "";
  61.  
  62.  
  63.   return InitHeadHTML;
  64. }
  65.  
  66. function  WWHIndex_InitBodyHTML()
  67. {
  68.   var  VarHTML = new WWHStringBuffer_Object();
  69.   var  VarBookList = WWHFrame.WWHHelp.mBooks.mBookList;
  70.  
  71.  
  72.   // Display initializing message
  73.   //
  74.   VarHTML.fAppend("<h2>" + WWHFrame.WWHJavaScript.mMessages.mInitializingMessage + "</h2>\n");
  75.  
  76.   // Load index data
  77.   //
  78.   this.mInitIndex = 0;
  79.   for (MaxIndex = VarBookList.length, Index = 0 ; Index < MaxIndex ; Index++)
  80.   {
  81.     // Reference Index data
  82.     //
  83.     VarHTML.fAppend("<script language=\"JavaScript1.2\" src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + WWHFrame.WWHBrowser.fRestoreEscapedSpaces(VarBookList[Index].mDirectory) + "wwhdata/js/index.js\"></script>\n");
  84.  
  85.     // Load Index data for current book
  86.     //
  87.     VarHTML.fAppend("<script language=\"JavaScript1.2\" src=\"" + WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/js/scripts/index1s.js\"></script>\n");
  88.   }
  89.  
  90.   return VarHTML.fGetBuffer();
  91. }
  92.  
  93. function  WWHIndex_InitLoadBookIndex(ParamAddIndexEntriesFunc)
  94. {
  95.   var  VarMaxIndex;
  96.   var  VarIndex;
  97.  
  98.  
  99.   // Load Index
  100.   //
  101.   ParamAddIndexEntriesFunc(this.mTopEntry);
  102.  
  103.   // Increment init book index
  104.   //
  105.   this.mInitIndex++;
  106.  
  107.   // Check if done
  108.   //
  109.   if (this.mInitIndex == WWHFrame.WWHHelp.mBooks.mBookList.length)
  110.   {
  111.     // Process see also entries to set up links between source and target
  112.     // Do this before the top level hashes are cleared by the sort children call
  113.     //
  114.     this.fProcessSeeAlsoEntries();
  115.  
  116.     // Sort top level entries
  117.     //
  118.     if (this.mTopEntry.mChildrenSortArray == null)
  119.     {
  120.       WWHIndexEntry_SortChildren(this.mTopEntry);
  121.     }
  122.  
  123.     // Assign section indices
  124.     //
  125.     for (VarMaxIndex = this.mTopEntry.mChildrenSortArray.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
  126.     {
  127.       this.mTopEntry.mChildrenSortArray[VarIndex].mSectionIndex = VarIndex;
  128.     }
  129.  
  130.     // Panel is initialized
  131.     //
  132.     this.mbPanelInitialized = true;
  133.   }
  134. }
  135.  
  136. function  WWHIndex_AddSeeAlsoEntry(ParamEntry)
  137. {
  138.   this.mSeeAlsoArray[this.mSeeAlsoArray.length] = ParamEntry;
  139. }
  140.  
  141. function  WWHIndex_ProcessSeeAlsoEntries()
  142. {
  143.   var  VarMaxIndex;
  144.   var  VarIndex;
  145.   var  VarEntry;
  146.   var  VarSeeAlsoGroupEntry;
  147.   var  VarSeeAlsoEntry;
  148.  
  149.  
  150.   // Set see also references
  151.   //
  152.   for (VarMaxIndex = this.mSeeAlsoArray.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
  153.   {
  154.     // Access entry
  155.     //
  156.     VarEntry = this.mSeeAlsoArray[VarIndex];
  157.  
  158.     // Access group entry
  159.     //
  160.     VarSeeAlsoGroupEntry = this.mTopEntry.mChildren[VarEntry.mSeeAlsoGroupKey + "~"];
  161.     if ((typeof(VarSeeAlsoGroupEntry) != "undefined") &&
  162.         (VarSeeAlsoGroupEntry != null) &&
  163.         (VarSeeAlsoGroupEntry.mChildren != null))
  164.     {
  165.       // Access see also entry
  166.       //
  167.       VarSeeAlsoEntry = VarSeeAlsoGroupEntry.mChildren[VarEntry.mSeeAlsoKey + "~"];
  168.       if ((typeof(VarSeeAlsoEntry) != "undefined") &&
  169.           (VarSeeAlsoEntry != null))
  170.       {
  171.         // Setup links between source and destination
  172.         //
  173.  
  174.         // See if target entry is already tagged
  175.         //
  176.         if (typeof(VarSeeAlsoEntry.mSeeAlsoTargetName) == "undefined")
  177.         {
  178.           // Update target entry
  179.           //
  180.           VarSeeAlsoEntry.mSeeAlsoTargetName = "s" + VarIndex;
  181.         }
  182.  
  183.         // Update source entry
  184.         //
  185.         VarEntry.mSeeAlsoTargetName = VarSeeAlsoEntry.mSeeAlsoTargetName;
  186.         VarEntry.mSeeAlsoTargetGroupID = VarSeeAlsoGroupEntry.mGroupID;
  187.       }
  188.     }
  189.   }
  190.  
  191.   // Clear see also array
  192.   //
  193.   this.mSeeAlsoArray = null;
  194. }
  195.  
  196. function  WWHIndex_NavigationHeadHTML()
  197. {
  198.   var  HTML = new WWHStringBuffer_Object();
  199.  
  200.  
  201.   // Generate style section
  202.   //
  203.   HTML.fAppend("<style type=\"text/css\">\n");
  204.   HTML.fAppend(" <!--\n");
  205.   HTML.fAppend("  a.selected\n");
  206.   HTML.fAppend("  {\n");
  207.   HTML.fAppend("    text-decoration: none;\n");
  208.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mNavigationCurrentColor + ";\n");
  209.   HTML.fAppend("  }\n");
  210.   HTML.fAppend("  a.enabled\n");
  211.   HTML.fAppend("  {\n");
  212.   HTML.fAppend("    text-decoration: none;\n");
  213.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mNavigationEnabledColor + ";\n");
  214.   HTML.fAppend("  }\n");
  215.   HTML.fAppend("  p.navigation\n");
  216.   HTML.fAppend("  {\n");
  217.   HTML.fAppend("    margin-top: 1pt;\n");
  218.   HTML.fAppend("    margin-bottom: 1pt;\n");
  219.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mNavigationDisabledColor + ";\n");
  220.   HTML.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mIndex.mNavigationFontStyle + ";\n");
  221.   HTML.fAppend("  }\n");
  222.   HTML.fAppend(" -->\n");
  223.   HTML.fAppend("</style>\n");
  224.  
  225.   return HTML.fGetBuffer();
  226. }
  227.  
  228. function  WWHIndex_NavigationBodyHTML()
  229. {
  230.   var  HTML = new WWHStringBuffer_Object();
  231.   var  VarCacheKey;
  232.  
  233.  
  234.   // Define accessor functions to reduce file size
  235.   //
  236.   HTML.fAppend("<script type=\"text/javascript\" language=\"JavaScript1.2\">\n");
  237.   HTML.fAppend(" <!--\n");
  238.   HTML.fAppend("  function  fD(ParamSectionIndex)\n");
  239.   HTML.fAppend("  {\n");
  240.   HTML.fAppend("    WWHFrame.WWHIndex.fDisplaySection(ParamSectionIndex);\n");
  241.   HTML.fAppend("  }\n");
  242.   HTML.fAppend(" // -->\n");
  243.   HTML.fAppend("</script>\n");
  244.  
  245.   // Display navigation shortcuts
  246.   //
  247.   if (this.fThresholdExceeded())
  248.   {
  249.     VarCacheKey = this.mSectionIndex;
  250.   }
  251.   else
  252.   {
  253.     VarCacheKey = -1;
  254.   }
  255.  
  256.   // Calculate section navigation if not already cached
  257.   //
  258.   if (typeof(this.mSectionCache[VarCacheKey]) == "undefined")
  259.   {
  260.     this.mSectionCache[VarCacheKey] = this.fGetSectionNavigation();
  261.   }
  262.  
  263.   // Display section selection
  264.   //
  265.   HTML.fAppend(this.mSectionCache[VarCacheKey]);
  266.   HTML.fAppend("<p> </p>\n");
  267.  
  268.   return HTML.fGetBuffer();
  269. }
  270.  
  271. function  WWHIndex_HeadHTML()
  272. {
  273.   var  HTML = new WWHStringBuffer_Object();
  274.   var  MaxLevel;
  275.   var  Level;
  276.  
  277.  
  278.   // Generate style section
  279.   //
  280.   HTML.fAppend("<style type=\"text/css\">\n");
  281.   HTML.fAppend(" <!--\n");
  282.   HTML.fAppend("  a.Section\n");
  283.   HTML.fAppend("  {\n");
  284.   HTML.fAppend("    text-decoration: none;\n");
  285.   HTML.fAppend("    font-weight: bold;\n");
  286.   HTML.fAppend("  }\n");
  287.   HTML.fAppend("  a:active\n");
  288.   HTML.fAppend("  {\n");
  289.   HTML.fAppend("    text-decoration: none;\n");
  290.   HTML.fAppend("    background-color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mHighlightColor + ";\n");
  291.   HTML.fAppend("  }\n");
  292.   HTML.fAppend("  a:hover\n");
  293.   HTML.fAppend("  {\n");
  294.   HTML.fAppend("    text-decoration: underline;\n");
  295.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mEnabledColor + ";\n");
  296.   HTML.fAppend("  }\n");
  297.   HTML.fAppend("  a\n");
  298.   HTML.fAppend("  {\n");
  299.   HTML.fAppend("    text-decoration: none;\n");
  300.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mEnabledColor + ";\n");
  301.   HTML.fAppend("  }\n");
  302.   HTML.fAppend("  a.AnchorOnly\n");
  303.   HTML.fAppend("  {\n");
  304.   HTML.fAppend("    text-decoration: none;\n");
  305.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mDisabledColor + ";\n");
  306.   HTML.fAppend("  }\n");
  307.   HTML.fAppend("  p\n");
  308.   HTML.fAppend("  {\n");
  309.   HTML.fAppend("    margin-top: 1pt;\n");
  310.   HTML.fAppend("    margin-bottom: 1pt;\n");
  311.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mDisabledColor + ";\n");
  312.   HTML.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mIndex.mFontStyle + ";\n");
  313.   HTML.fAppend("  }\n");
  314.   for (MaxLevel = this.mMaxLevel + 1, Level = 0 ; Level <= MaxLevel ; Level++)
  315.   {
  316.     HTML.fAppend("  p.l" + Level + "\n");
  317.     HTML.fAppend("  {\n");
  318.     HTML.fAppend("    margin-left: " + (WWHFrame.WWHJavaScript.mSettings.mIndex.mIndent * Level) + "pt;\n");
  319.     HTML.fAppend("  }\n");
  320.   }
  321.   HTML.fAppend(" -->\n");
  322.   HTML.fAppend("</style>\n");
  323.  
  324.   return HTML.fGetBuffer();
  325. }
  326.  
  327. function  WWHIndex_StartHTMLSegments()
  328. {
  329.   var  HTML = new WWHStringBuffer_Object();
  330.  
  331.  
  332.   // Setup iterator for display
  333.   //
  334.   if (this.fThresholdExceeded())
  335.   {
  336.     this.mIterator.fReset(this.mSectionIndex);
  337.   }
  338.   else
  339.   {
  340.     this.mIterator.fReset(-1);
  341.   }
  342.  
  343.   // Define accessor functions to reduce file size
  344.   //
  345.   HTML.fAppend("<script type=\"text/javascript\" language=\"JavaScript1.2\">\n");
  346.   HTML.fAppend(" <!--\n");
  347.   HTML.fAppend("  function  fC(ParamEntryInfo)\n");
  348.   HTML.fAppend("  {\n");
  349.   HTML.fAppend("    WWHFrame.WWHIndex.fClickedEntry(ParamEntryInfo);\n");
  350.   HTML.fAppend("  }\n");
  351.   HTML.fAppend("\n");
  352.   HTML.fAppend("  function  fA(ParamEntryInfo)\n");
  353.   HTML.fAppend("  {\n");
  354.   HTML.fAppend("    WWHFrame.WWHIndex.fClickedSeeAlsoEntry(ParamEntryInfo);\n");
  355.   HTML.fAppend("  }\n");
  356.   HTML.fAppend("\n");
  357.   HTML.fAppend("  function  fS(ParamEntryID,\n");
  358.   HTML.fAppend("               ParamEvent)\n");
  359.   HTML.fAppend("  {\n");
  360.   HTML.fAppend("    WWHFrame.WWHJavaScript.mPanels.mPopup.fShow(ParamEntryID, ParamEvent);\n");
  361.   HTML.fAppend("  }\n");
  362.   HTML.fAppend("\n");
  363.   HTML.fAppend("  function  fH()\n");
  364.   HTML.fAppend("  {\n");
  365.   HTML.fAppend("    WWHFrame.WWHJavaScript.mPanels.mPopup.fHide();\n");
  366.   HTML.fAppend("  }\n");
  367.   HTML.fAppend(" // -->\n");
  368.   HTML.fAppend("</script>\n");
  369.  
  370.   return HTML.fGetBuffer();
  371. }
  372.  
  373. function  WWHIndex_AdvanceHTMLSegment()
  374. {
  375.   var  MaxHTMLSegmentSize = WWHFrame.WWHJavaScript.mMaxHTMLSegmentSize;
  376.   var  mbAccessible = WWHFrame.WWHHelp.mbAccessible;
  377.   var  BaseEntryInfo = "";
  378.   var  Entry;
  379.   var  EntryAnchorName;
  380.   var  VarAccessibilityTitle = "";
  381.   var  MaxIndex;
  382.   var  Index;
  383.   var  VarParentEntry;
  384.   var  EntryPrefix;
  385.   var  EntrySuffix;
  386.   var  EntryInfo;
  387.  
  388.  
  389.   // Add index in top entry to entry info if IteratorScope != TopEntry
  390.   //
  391.   if (this.fThresholdExceeded())
  392.   {
  393.     BaseEntryInfo += this.mSectionIndex;
  394.   }
  395.  
  396.   this.mHTMLSegment.fReset();
  397.   while ((this.mHTMLSegment.fSize() < MaxHTMLSegmentSize) &&
  398.          (this.mIterator.fAdvance()))
  399.   {
  400.     Entry = this.mIterator.mEntry;
  401.  
  402.     // Insert breaks between sections
  403.     //
  404.     if (Entry.mbGroup)
  405.     {
  406.       // Emit spacing, if necessary
  407.       //
  408.       if (this.mHTMLSegment.fSize() == 0)
  409.       {
  410.         // No spacing
  411.         //
  412.       }
  413.       else
  414.       {
  415.         // Emit a space
  416.         //
  417.         this.mHTMLSegment.fAppend("<p> </p>\n");
  418.       }
  419.     }
  420.  
  421.     // Display the entry
  422.     //
  423.  
  424.     // See if entry needs a named anchor target
  425.     //
  426.     if (typeof(Entry.mSeeAlsoTargetName) == "string")
  427.     {
  428.       EntryAnchorName = " name=\"sa" + Entry.mSeeAlsoTargetName + "\"";
  429.     }
  430.     else
  431.     {
  432.       EntryAnchorName = "";
  433.     }
  434.  
  435.     // Determine accessibility title
  436.     //
  437.     if (mbAccessible)
  438.     {
  439.       VarAccessibilityTitle = "";
  440.       for (MaxIndex = this.mIterator.mParentStack.length, Index = 0 ; Index < MaxIndex ; Index++)
  441.       {
  442.         VarParentEntry = this.mIterator.mParentStack[Index];
  443.  
  444.         if ((VarParentEntry == this.mTopEntry) ||
  445.             (VarParentEntry.mbGroup))
  446.         {
  447.           // Nothing to do
  448.           //
  449.         }
  450.         else
  451.         {
  452.           VarAccessibilityTitle += VarParentEntry.mText + WWHFrame.WWHHelp.mMessages.mAccessibilityListSeparator + " ";
  453.         }
  454.       }
  455.  
  456.       VarAccessibilityTitle += Entry.mText;
  457.  
  458.       VarAccessibilityTitle = WWHStringUtilities_EscapeHTML(VarAccessibilityTitle);
  459.  
  460.       VarAccessibilityTitle = " title=\"" + VarAccessibilityTitle + "\"";
  461.     }
  462.  
  463.     // Determine entry type
  464.     //
  465.     if (Entry.mbGroup)
  466.     {
  467.       EntryPrefix = "<b><a class=\"Section\" name=\"section" + Entry.mSectionIndex + "\">";
  468.       EntrySuffix = "</a></b>";
  469.     }
  470.     else if (typeof(Entry.mSeeAlsoKey) == "string")
  471.     {
  472.       if (typeof(Entry.mSeeAlsoTargetName) == "string")
  473.       {
  474.         // Use position stack for link info
  475.         //
  476.         EntryInfo = BaseEntryInfo;
  477.         for (MaxIndex = this.mIterator.mPositionStack.length, Index = 0 ; Index < MaxIndex ; Index++)
  478.         {
  479.           if (EntryInfo.length > 0)
  480.           {
  481.             EntryInfo += ":";
  482.           }
  483.           EntryInfo += this.mIterator.mPositionStack[Index];
  484.         }
  485.  
  486.         EntryPrefix = "<i><a href=\"javascript:fA('" + EntryInfo + "');\"" + this.fGetPopupAction(EntryInfo) + VarAccessibilityTitle + ">";
  487.         EntrySuffix = "</a></i>";
  488.       }
  489.       else
  490.       {
  491.         EntryPrefix = "<i>";
  492.         EntrySuffix = "</i>";
  493.       }
  494.     }
  495.     else if (Entry.mBookLinks != null)
  496.     {
  497.       // Use position stack for link info
  498.       //
  499.       EntryInfo = BaseEntryInfo;
  500.       for (MaxIndex = this.mIterator.mPositionStack.length, Index = 0 ; Index < MaxIndex ; Index++)
  501.       {
  502.         if (EntryInfo.length > 0)
  503.         {
  504.           EntryInfo += ":";
  505.         }
  506.         EntryInfo += this.mIterator.mPositionStack[Index];
  507.       }
  508.  
  509.       EntryPrefix = "<a" + EntryAnchorName + " href=\"javascript:fC('" + EntryInfo + "');\"" + this.fGetPopupAction(EntryInfo) + VarAccessibilityTitle + ">";
  510.       EntrySuffix = "</a>";
  511.     }
  512.     else if (EntryAnchorName.length > 0)
  513.     {
  514.       EntryPrefix = "<a class=\"AnchorOnly\"" + EntryAnchorName + VarAccessibilityTitle + ">";
  515.       EntrySuffix = "</a>";
  516.     }
  517.     else
  518.     {
  519.       EntryPrefix = "";
  520.       EntrySuffix = "";
  521.     }
  522.  
  523.     this.mHTMLSegment.fAppend("<p class=l" + (this.mIterator.mPositionStack.length) + "><nobr>" + EntryPrefix + Entry.mText + EntrySuffix + "</nobr></p>\n");
  524.   }
  525.  
  526.   return (this.mHTMLSegment.fSize() > 0);
  527. }
  528.  
  529. function  WWHIndex_GetHTMLSegment()
  530. {
  531.   return this.mHTMLSegment.fGetBuffer();
  532. }
  533.  
  534. function  WWHIndex_EndHTMLSegments()
  535. {
  536.   return "";
  537. }
  538.  
  539. function  WWHIndex_PanelNavigationLoaded()
  540. {
  541.   // Restore focus
  542.   //
  543.   WWHFrame.WWHHelp.fFocus("WWHPanelNavigationFrame", "in" + this.mSectionIndex);
  544. }
  545.  
  546. function  WWHIndex_PanelViewLoaded()
  547. {
  548. }
  549.  
  550. function  WWHIndex_HoverTextTranslate(ParamEntryInfo)
  551. {
  552.   var  Entry;
  553.  
  554.  
  555.   // Locate specified entry
  556.   //
  557.   Entry = this.fGetEntry(ParamEntryInfo);
  558.  
  559.   return Entry.mText;
  560. }
  561.  
  562. function  WWHIndex_HoverTextFormat(ParamWidth,
  563.                                    ParamTextID,
  564.                                    ParamText)
  565. {
  566.   var  FormattedText   = "";
  567.   var  ForegroundColor = WWHFrame.WWHJavaScript.mSettings.mHoverText.mForegroundColor;
  568.   var  BackgroundColor = WWHFrame.WWHJavaScript.mSettings.mHoverText.mBackgroundColor;
  569.   var  BorderColor     = WWHFrame.WWHJavaScript.mSettings.mHoverText.mBorderColor;
  570.   var  ImageDir        = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
  571.   var  ReqSpacer1w2h   = "<img src=\"" + ImageDir + "/spc1w2h.gif\" width=1 height=2>";
  572.   var  ReqSpacer2w1h   = "<img src=\"" + ImageDir + "/spc2w1h.gif\" width=2 height=1>";
  573.   var  ReqSpacer1w7h   = "<img src=\"" + ImageDir + "/spc1w7h.gif\" width=1 height=7>";
  574.   var  ReqSpacer5w1h   = "<img src=\"" + ImageDir + "/spc5w1h.gif\" width=5 height=1>";
  575.   var  Spacer1w2h      = ReqSpacer1w2h;
  576.   var  Spacer2w1h      = ReqSpacer2w1h;
  577.   var  Spacer1w7h      = ReqSpacer1w7h;
  578.   var  Spacer5w1h      = ReqSpacer5w1h;
  579.  
  580.  
  581.   // Netscape 6.x (Mozilla) renders table cells with graphics
  582.   // incorrectly inside of <div> tags that are rewritten on the fly
  583.   //
  584.   if (WWHFrame.WWHBrowser.mBrowser == 4)  // Shorthand for Netscape 6.x (Mozilla)
  585.   {
  586.     Spacer1w2h = "";
  587.     Spacer2w1h = "";
  588.     Spacer1w7h = "";
  589.     Spacer5w1h = "";
  590.   }
  591.  
  592.   FormattedText += "<table width=\"" + ParamWidth + "\" border=0 cellspacing=0 cellpadding=0 bgcolor=\"" + BackgroundColor + "\">";
  593.   FormattedText += " <tr>";
  594.   FormattedText += "  <td height=2 colspan=5 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>";
  595.   FormattedText += " </tr>";
  596.  
  597.   FormattedText += " <tr>";
  598.   FormattedText += "  <td height=7 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  599.   FormattedText += "  <td height=7 colspan=3>" + Spacer1w7h + "</td>";
  600.   FormattedText += "  <td height=7 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  601.   FormattedText += " </tr>";
  602.  
  603.   FormattedText += " <tr>";
  604.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  605.   FormattedText += "  <td>" + ReqSpacer5w1h + "</td>";
  606.   FormattedText += "  <td width=\"100%\" id=\"" + ParamTextID + "\" style=\"color: " + ForegroundColor + " ; " + WWHFrame.WWHJavaScript.mSettings.mHoverText.mFontStyle + "\">" + ParamText + "</td>";
  607.   FormattedText += "  <td>" + ReqSpacer5w1h + "</td>";
  608.   FormattedText += "  <td bgcolor=\"" + BorderColor + "\">" + ReqSpacer2w1h + "</td>";
  609.   FormattedText += " </tr>";
  610.  
  611.   FormattedText += " <tr>";
  612.   FormattedText += "  <td height=7 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  613.   FormattedText += "  <td height=7 colspan=3>" + Spacer1w7h + "</td>";
  614.   FormattedText += "  <td height=7 bgcolor=\"" + BorderColor + "\">" + Spacer2w1h + "</td>";
  615.   FormattedText += " </tr>";
  616.  
  617.   FormattedText += " <tr>";
  618.   FormattedText += "  <td height=2 colspan=5 bgcolor=\"" + BorderColor + "\">" + Spacer1w2h + "</td>";
  619.   FormattedText += " </tr>";
  620.   FormattedText += "</table>";
  621.  
  622.   return FormattedText;
  623. }
  624.  
  625. function  WWHIndex_GetPopupAction(ParamEntryInfo)
  626. {
  627.   var  PopupAction = "";
  628.  
  629.  
  630.   if (WWHFrame.WWHJavaScript.mSettings.mHoverText.mbEnabled)
  631.   {
  632.     PopupAction += " onMouseOver=\"fS('" + ParamEntryInfo + "', " + this.mEventString + ");\"";
  633.     PopupAction += " onMouseOut=\"fH();\"";
  634.   }
  635.  
  636.   return PopupAction;
  637. }
  638.  
  639. function  WWHIndex_ThresholdExceeded()
  640. {
  641.   if (this.mbThresholdExceeded == null)
  642.   {
  643.     if ((WWHFrame.WWHHelp.mbAccessible) ||
  644.         ((this.mOptions.mThreshold > 0) &&
  645.          (this.mEntryCount > this.mOptions.mThreshold)))
  646.     {
  647.       this.mbThresholdExceeded = true;
  648.     }
  649.     else
  650.     {
  651.       this.mbThresholdExceeded = false;
  652.     }
  653.   }
  654.  
  655.   return this.mbThresholdExceeded;
  656. }
  657.  
  658. function  WWHIndex_GetSectionNavigation()
  659. {
  660.   var  SectionNavHTML = "";
  661.   var  SectionArray;
  662.   var  MaxIndex;
  663.   var  Index;
  664.  
  665.  
  666.   SectionNavHTML += "<p class=\"navigation\">";
  667.  
  668.   // Calculate section selection
  669.   //
  670.   SectionArray = this.mTopEntry.mChildrenSortArray;
  671.   for (MaxIndex = SectionArray.length, Index = 0 ; Index < MaxIndex ; Index++)
  672.   {
  673.     // Add spacers if necessary
  674.     //
  675.     if (Index > 0)
  676.     {
  677.       SectionNavHTML += this.mOptions.mSeperator;
  678.     }
  679.  
  680.     // Display section with or without link as necessary
  681.     //
  682.     if ((this.fThresholdExceeded()) &&
  683.         (Index == this.mSectionIndex))  // Currently being displayed
  684.     {
  685.       SectionNavHTML += "<a class=\"selected\" name=\"in" + Index + "\" href=\"javascript:void(0);\">" + SectionArray[Index].mText + "</a>";
  686.     }
  687.     else if ((SectionArray[Index].mChildren == null) &&         // Always display group
  688.              (SectionArray[Index].mChildrenSortArray == null))  // SortArray null before sort, hash null after
  689.     {
  690.       SectionNavHTML += SectionArray[Index].mText;
  691.     }
  692.     else
  693.     {
  694.       SectionNavHTML += "<a class=\"enabled\" name=\"in" + Index + "\" href=\"javascript:fD(" + Index + ");\">" + SectionArray[Index].mText + "</a>";
  695.     }
  696.   }
  697.  
  698.   SectionNavHTML += "</p>";
  699.  
  700.   return SectionNavHTML;
  701. }
  702.  
  703. function  WWHIndex_DisplaySection(ParamSectionIndex)
  704. {
  705.   // Set section
  706.   //
  707.   this.mSectionIndex = ParamSectionIndex;
  708.  
  709.   if (this.fThresholdExceeded())
  710.   {
  711.     // Reload panel
  712.     //
  713.     WWHFrame.WWHJavaScript.mPanels.fClearScrollPosition();
  714.     WWHFrame.WWHJavaScript.mPanels.fReloadPanel();
  715.   }
  716.   else
  717.   {
  718.     // Focus current section
  719.     //
  720.     WWHFrame.WWHHelp.fFocus("WWHPanelNavigationFrame", "in" + this.mSectionIndex);
  721.  
  722.     // Whole index already visible, just jump to the specified entry
  723.     //
  724.     this.mPanelAnchor = "section" + this.mSectionIndex;
  725.  
  726.     // Workaround for IE problems
  727.     //
  728.     if (WWHFrame.WWHBrowser.mbSupportsFocus)
  729.     {
  730.       if (WWHFrame.WWHBrowser.mBrowser == 2)  // Shorthand for IE
  731.       {
  732.         WWHFrame.WWHBrowser.mbSupportsFocus = false;
  733.  
  734.         WWHFrame.WWHJavaScript.mPanels.fJumpToAnchor();
  735.  
  736.         WWHFrame.WWHBrowser.mbSupportsFocus = true;
  737.       }
  738.     }
  739.  
  740.     WWHFrame.WWHJavaScript.mPanels.fJumpToAnchor();
  741.   }
  742. }
  743.  
  744. function  WWHIndex_SelectionListHeadHTML()
  745. {
  746.   var  HTML = new WWHStringBuffer_Object();
  747.   var  Level;
  748.  
  749.  
  750.   HTML.fAppend("<style type=\"text/css\">\n");
  751.   HTML.fAppend(" <!--\n");
  752.   HTML.fAppend("  a\n");
  753.   HTML.fAppend("  {\n");
  754.   HTML.fAppend("    text-decoration: none;\n");
  755.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mEnabledColor + ";\n");
  756.   HTML.fAppend("  }\n");
  757.   HTML.fAppend("  p\n");
  758.   HTML.fAppend("  {\n");
  759.   HTML.fAppend("    margin-top: 1pt;\n");
  760.   HTML.fAppend("    margin-bottom: 1pt;\n");
  761.   HTML.fAppend("    color: " + WWHFrame.WWHJavaScript.mSettings.mIndex.mDisabledColor + ";\n");
  762.   HTML.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mIndex.mFontStyle + ";\n");
  763.   HTML.fAppend("  }\n");
  764.   for (Level = 1 ; Level < 3 ; Level++)
  765.   {
  766.     HTML.fAppend("  p.l" + Level + "\n");
  767.     HTML.fAppend("  {\n");
  768.     HTML.fAppend("    margin-left: " + (WWHFrame.WWHJavaScript.mSettings.mIndex.mIndent * Level) + "pt;\n");
  769.     HTML.fAppend("  }\n");
  770.   }
  771.   HTML.fAppend("  h2\n");
  772.   HTML.fAppend("  {\n");
  773.   HTML.fAppend("    " + WWHFrame.WWHJavaScript.mSettings.mIndex.mFontStyle + ";\n");
  774.   HTML.fAppend("  }\n");
  775.   HTML.fAppend(" -->\n");
  776.   HTML.fAppend("</style>\n");
  777.  
  778.   return HTML.fGetBuffer();
  779. }
  780.  
  781. function  WWHIndex_SelectionListBodyHTML()
  782. {
  783.   var  HTML = new WWHStringBuffer_Object();
  784.   var  BookList = WWHFrame.WWHHelp.mBooks.mBookList;
  785.   var  EntryClass;
  786.   var  MaxBookIndex;
  787.   var  BookIndex;
  788.   var  BookListEntry;
  789.   var  LinkArray;
  790.   var  MaxLinkIndex;
  791.   var  LinkIndex;
  792.   var  Parts;
  793.   var  PrevLinkFileIndex;
  794.   var  LinkFileIndex;
  795.   var  LinkAnchor;
  796.   var  VarAccessibilityTitle;
  797.   var  NumberedLinkCounter;
  798.   var  DocumentURL;
  799.  
  800.  
  801.   if (this.mClickedEntry != null)
  802.   {
  803.     // Display multiple entry message
  804.     //
  805.     HTML.fAppend("<h2>");
  806.     HTML.fAppend(WWHFrame.WWHJavaScript.mMessages.mIndexSelectMessage1 + " ");
  807.     HTML.fAppend(WWHFrame.WWHJavaScript.mMessages.mIndexSelectMessage2);
  808.     HTML.fAppend("</h2>\n");
  809.  
  810.     // Display text of entry clicked
  811.     //
  812.     HTML.fAppend("<p><b>" + this.mClickedEntry.mText + "</b></p>\n");
  813.  
  814.     // Determine level at which to display entries
  815.     //
  816.     if (BookList.length == 1)
  817.     {
  818.       EntryClass = "l1";
  819.     }
  820.     else
  821.     {
  822.       EntryClass = "l2";
  823.     }
  824.  
  825.     // Display each book's link for this entry
  826.     //
  827.     for (MaxBookIndex = BookList.length, BookIndex = 0 ; BookIndex < MaxBookIndex ; BookIndex++)
  828.     {
  829.       if (typeof(this.mClickedEntry.mBookLinks[BookIndex]) != "undefined")
  830.       {
  831.         BookListEntry = BookList[BookIndex];
  832.  
  833.         // Write the book's title, if necessary
  834.         //
  835.         if (BookList.length > 1)
  836.         {
  837.           HTML.fAppend("<p> </p>\n");
  838.           HTML.fAppend("<p class=\"l1\"><nobr><b>" + BookListEntry.mTitle + "</b>");
  839.         }
  840.  
  841.         // Sort link array to group files with anchors
  842.         //
  843.         // Use for loop to copy entries to workaround bug/problem in IE 5.0 on Windows
  844.         //
  845.         LinkArray = new Array();
  846.         for (MaxLinkIndex = this.mClickedEntry.mBookLinks[BookIndex].length, LinkIndex = 0 ; LinkIndex < MaxLinkIndex ; LinkIndex++)
  847.         {
  848.           LinkArray[LinkIndex] = this.mClickedEntry.mBookLinks[BookIndex][LinkIndex];
  849.         }
  850.         LinkArray = LinkArray.sort();
  851.  
  852.         // Now display file links
  853.         //
  854.         PrevLinkFileIndex = null;
  855.         for (MaxLinkIndex = LinkArray.length, LinkIndex = 0 ; LinkIndex < MaxLinkIndex ; LinkIndex++)
  856.         {
  857.           // Determine link file index and anchor
  858.           //
  859.           Parts = LinkArray[LinkIndex].split("#");
  860.           LinkFileIndex = parseInt(Parts[0]);
  861.           LinkAnchor = null;
  862.           if (Parts.length > 1)
  863.           {
  864.             if (Parts[1].length > 0)
  865.             {
  866.               LinkAnchor = Parts[1];
  867.             }
  868.           }
  869.  
  870.           // Determine if all links for a single document have been processed
  871.           //
  872.           if ((PrevLinkFileIndex == null) ||
  873.               (LinkFileIndex != PrevLinkFileIndex))
  874.           {
  875.             NumberedLinkCounter = 1;
  876.  
  877.             // Determine title for accessibility
  878.             //
  879.             if (WWHFrame.WWHHelp.mbAccessible)
  880.             {
  881.               VarAccessibilityTitle = WWHStringUtilities_FormatMessage(WWHFrame.WWHJavaScript.mMessages.mAccessibilityIndexEntry,
  882.                                                                        BookListEntry.mFiles.fFileIndexToTitle(LinkFileIndex),
  883.                                                                        BookListEntry.mTitle);
  884.               VarAccessibilityTitle = WWHStringUtilities_EscapeHTML(VarAccessibilityTitle);
  885.               VarAccessibilityTitle = " title=\"" + VarAccessibilityTitle + "\"";
  886.             }
  887.  
  888.             HTML.fAppend("</nobr></p>\n");
  889.  
  890.             // Build up absolute link URL
  891.             //
  892.             DocumentURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(BookIndex, LinkFileIndex, LinkAnchor);
  893.             DocumentURL = WWHFrame.WWHBrowser.fRestoreEscapedSpaces(DocumentURL);
  894.             DocumentURL = WWHStringUtilities_EscapeURLForJavaScriptAnchor(DocumentURL);
  895.  
  896.             HTML.fAppend("<p class=\"" + EntryClass + "\"><nobr>");
  897.             HTML.fAppend("<a name=\"indexselect\" href=\"javascript:WWHFrame.WWHIndex.fDisplayLink('" + DocumentURL + "');\"" + VarAccessibilityTitle + ">");
  898.             HTML.fAppend(BookListEntry.mFiles.fFileIndexToTitle(LinkFileIndex) + "</a>");
  899.           }
  900.           else
  901.           {
  902.             NumberedLinkCounter += 1;
  903.  
  904.             // Determine title for accessibility
  905.             //
  906.             if (WWHFrame.WWHHelp.mbAccessible)
  907.             {
  908.               VarAccessibilityTitle = WWHStringUtilities_FormatMessage(WWHFrame.WWHJavaScript.mMessages.mAccessibilityIndexSecondEntry,
  909.                                                                        BookListEntry.mFiles.fFileIndexToTitle(LinkFileIndex),
  910.                                                                        BookListEntry.mTitle,
  911.                                                                        NumberedLinkCounter);
  912.               VarAccessibilityTitle = WWHStringUtilities_EscapeHTML(VarAccessibilityTitle);
  913.               VarAccessibilityTitle = " title=\"" + VarAccessibilityTitle + "\"";
  914.             }
  915.  
  916.             // Build up absolute link URL
  917.             //
  918.             DocumentURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(BookIndex, LinkFileIndex, LinkAnchor);
  919.             DocumentURL = WWHFrame.WWHBrowser.fRestoreEscapedSpaces(DocumentURL);
  920.             DocumentURL = WWHStringUtilities_EscapeURLForJavaScriptAnchor(DocumentURL);
  921.  
  922.             HTML.fAppend(", ");
  923.             HTML.fAppend("<a href=\"javascript:WWHFrame.WWHIndex.fDisplayLink('" + DocumentURL + "');\"" + VarAccessibilityTitle + ">");
  924.             HTML.fAppend(NumberedLinkCounter + "</a>");
  925.           }
  926.  
  927.           PrevLinkFileIndex = LinkFileIndex;
  928.         }
  929.  
  930.         HTML.fAppend("</nobr></p>\n");
  931.       }
  932.     }
  933.   }
  934.  
  935.   return HTML.fGetBuffer();
  936. }
  937.  
  938. function  WWHIndex_SelectionListLoaded()
  939. {
  940.   // Move focus to document selection list
  941.   //
  942.   WWHFrame.WWHHelp.fFocus("WWHDocumentFrame", "indexselect");
  943. }
  944.  
  945. function  WWHIndex_DisplayLink(ParamURL)
  946. {
  947.   WWHFrame.WWHHelp.fSetDocumentHREF(ParamURL, false);
  948. }
  949.  
  950. function  WWHIndex_GetEntry(ParamEntryInfo)
  951. {
  952.   var  Entry = null;
  953.   var  EntryInfoParts;
  954.   var  MaxIndex;
  955.   var  Index;
  956.  
  957.  
  958.   // Locate specified entry
  959.   //
  960.   Entry = this.mTopEntry;
  961.   EntryInfoParts = ParamEntryInfo.split(":");
  962.   for (MaxIndex = EntryInfoParts.length, Index = 0 ; Index < MaxIndex ; Index++)
  963.   {
  964.     Entry = Entry.mChildrenSortArray[EntryInfoParts[Index]];
  965.   }
  966.  
  967.   return Entry;
  968. }
  969.  
  970. function  WWHIndex_ClickedEntry(ParamEntryInfo)
  971. {
  972.   var  Entry;
  973.   var  BookCount;
  974.   var  BookIndex;
  975.   var  BookListEntry;
  976.   var  Parts;
  977.   var  LinkFileIndex;
  978.   var  LinkAnchor;
  979.   var  DocumentURL;
  980.  
  981.  
  982.   // Locate specified entry
  983.   //
  984.   Entry = this.fGetEntry(ParamEntryInfo);
  985.  
  986.   // Display target document or selection list
  987.   //
  988.   BookCount = 0;
  989.   for (BookIndex in Entry.mBookLinks)
  990.   {
  991.     BookCount++;
  992.   }
  993.  
  994.   // See if this is a single entry
  995.   //
  996.   if ((BookCount == 1) &&
  997.       (Entry.mBookLinks[BookIndex].length == 1))
  998.   {
  999.     BookListEntry = WWHFrame.WWHHelp.mBooks.mBookList[BookIndex];
  1000.  
  1001.     // Determine link file index and anchor
  1002.     //
  1003.     Parts = Entry.mBookLinks[BookIndex][0].split("#");
  1004.     LinkFileIndex = parseInt(Parts[0]);
  1005.     LinkAnchor = null;
  1006.     if (Parts.length > 1)
  1007.     {
  1008.       if (Parts[1].length > 0)
  1009.       {
  1010.         LinkAnchor = Parts[1];
  1011.       }
  1012.     }
  1013.  
  1014.     // Set Document
  1015.     //
  1016.     DocumentURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(BookIndex, LinkFileIndex, LinkAnchor);
  1017.   }
  1018.   else
  1019.   {
  1020.     // Display selection list
  1021.     //
  1022.     this.mClickedEntry = Entry;
  1023.     DocumentURL = WWHFrame.WWHHelp.mBaseURL + "wwhelp/wwhimpl/js/html/indexsel.htm";
  1024.   }
  1025.  
  1026.   this.fDisplayLink(DocumentURL);
  1027. }
  1028.  
  1029. function  WWHIndex_ClickedSeeAlsoEntry(ParamEntryInfo)
  1030. {
  1031.   var  Entry;
  1032.   var  TargetSectionIndex;
  1033.   var  MaxIndex;
  1034.   var  Index;
  1035.  
  1036.  
  1037.   // Locate specified entry
  1038.   //
  1039.   Entry = this.fGetEntry(ParamEntryInfo);
  1040.  
  1041.   // Confirm entry has target information
  1042.   //
  1043.   if ((typeof(Entry.mSeeAlsoTargetName) == "string") &&
  1044.       (typeof(Entry.mSeeAlsoTargetGroupID) == "number"))
  1045.   {
  1046.     // Determine if we need to jump to another page
  1047.     //
  1048.     TargetSectionIndex = -1;
  1049.     for (MaxIndex = this.mTopEntry.mChildrenSortArray.length, Index = 0 ; Index < MaxIndex ; Index++)
  1050.     {
  1051.       if (this.mTopEntry.mChildrenSortArray[Index].mGroupID == Entry.mSeeAlsoTargetGroupID)
  1052.       {
  1053.         TargetSectionIndex = Index;
  1054.  
  1055.         // Exit for loop
  1056.         //
  1057.         Index = MaxIndex;
  1058.       }
  1059.     }
  1060.  
  1061.     // Confirm the target entry was located
  1062.     //
  1063.     if (TargetSectionIndex != -1)
  1064.     {
  1065.       // Set target entry
  1066.       //
  1067.       this.mPanelAnchor = "sa" + Entry.mSeeAlsoTargetName;
  1068.  
  1069.       // Change navigation bar?
  1070.       //
  1071.       if ((this.fThresholdExceeded()) &&
  1072.           (TargetSectionIndex != this.mSectionIndex))
  1073.       {
  1074.         // Need to switch to proper section
  1075.         //
  1076.         this.fDisplaySection(TargetSectionIndex);
  1077.       }
  1078.       else
  1079.       {
  1080.         // Focus current section
  1081.         //
  1082.         WWHFrame.WWHHelp.fFocus("WWHPanelNavigationFrame", "in" + this.mSectionIndex);
  1083.  
  1084.         // We're on the right page, so just jump to the correct entry
  1085.         //
  1086.         WWHFrame.WWHJavaScript.mPanels.fJumpToAnchor();
  1087.       }
  1088.     }
  1089.   }
  1090. }
  1091.  
  1092. function  WWHIndexIterator_Object()
  1093. {
  1094.   this.mIteratorScope      = null;
  1095.   this.mEntry              = null;
  1096.   this.mParentStack        = new Array();
  1097.   this.mPositionStack      = new Array();
  1098.  
  1099.   this.fReset   = WWHIndexIterator_Reset;
  1100.   this.fAdvance = WWHIndexIterator_Advance;
  1101. }
  1102.  
  1103. function  WWHIndexIterator_Reset(ParamIndex)
  1104. {
  1105.   if (ParamIndex == -1)  // Iterate buckets as well!
  1106.   {
  1107.     this.mIteratorScope = WWHFrame.WWHIndex.mTopEntry;
  1108.   }
  1109.   else
  1110.   {
  1111.     this.mIteratorScope = WWHFrame.WWHIndex.mTopEntry.mChildrenSortArray[ParamIndex];
  1112.   }
  1113.   this.mEntry                = this.mIteratorScope;
  1114.   this.mParentStack.length   = 0;
  1115.   this.mPositionStack.length = 0;
  1116. }
  1117.  
  1118. function  WWHIndexIterator_Advance()
  1119. {
  1120.   var  ParentEntry;
  1121.   var  StackTop;
  1122.  
  1123.  
  1124.   // Advance to the next visible entry
  1125.   //
  1126.   if (this.mEntry != null)
  1127.   {
  1128.     // Check for children
  1129.     //
  1130.     if (this.mEntry.mChildren != null)
  1131.     {
  1132.       // Determine sort order if necessary
  1133.       //
  1134.       if (this.mEntry.mChildrenSortArray == null)
  1135.       {
  1136.         WWHIndexEntry_SortChildren(this.mEntry);
  1137.       }
  1138.     }
  1139.  
  1140.     // Process children
  1141.     //
  1142.     if (this.mEntry.mChildrenSortArray != null)
  1143.     {
  1144.       this.mParentStack[this.mParentStack.length] = this.mEntry;
  1145.       this.mPositionStack[this.mPositionStack.length] = 0;
  1146.       this.mEntry = this.mEntry.mChildrenSortArray[0];
  1147.     }
  1148.     // If we've reached the iterator scope, we're done
  1149.     //
  1150.     else if (this.mEntry == this.mIteratorScope)
  1151.     {
  1152.       this.mEntry = null;
  1153.     }
  1154.     else
  1155.     {
  1156.       ParentEntry = this.mParentStack[this.mParentStack.length - 1];
  1157.       this.mEntry = null;
  1158.  
  1159.       // Find next child of parent entry
  1160.       //
  1161.       while (ParentEntry != null)
  1162.       {
  1163.         // Increment position
  1164.         //
  1165.         StackTop = this.mPositionStack.length - 1;
  1166.         this.mPositionStack[StackTop]++;
  1167.  
  1168.         // Confirm this is a valid entry
  1169.         //
  1170.         if (this.mPositionStack[StackTop] < ParentEntry.mChildrenSortArray.length)
  1171.         {
  1172.           // Return the parent's next child
  1173.           //
  1174.           this.mEntry = ParentEntry.mChildrenSortArray[this.mPositionStack[StackTop]];
  1175.  
  1176.           // Signal break from loop
  1177.           //
  1178.           ParentEntry = null;
  1179.         }
  1180.         else
  1181.         {
  1182.           // Last child of parent, try up a level
  1183.           //
  1184.           if (ParentEntry == this.mIteratorScope)
  1185.           {
  1186.             ParentEntry = null;
  1187.           }
  1188.           else
  1189.           {
  1190.             this.mParentStack.length--;
  1191.             this.mPositionStack.length--;
  1192.  
  1193.             ParentEntry = this.mParentStack[this.mParentStack.length - 1];
  1194.           }
  1195.         }
  1196.       }
  1197.     }
  1198.   }
  1199.  
  1200.   return (this.mEntry != null);
  1201. }
  1202.  
  1203. function  WWHIndexEntry_Object(bParamGroupHeading,
  1204.                                ParamBookIndex,
  1205.                                ParamText,
  1206.                                ParamLinks,
  1207.                                ParamSeeAlsoKey,
  1208.                                ParamSeeAlsoGroupKey)
  1209. {
  1210.   if (bParamGroupHeading)
  1211.   {
  1212.     this.mbGroup  = true;
  1213.     this.mGroupID = WWHFrame.WWHIndex.mEntryCount;
  1214.   }
  1215.   else
  1216.   {
  1217.     this.mbGroup = false;
  1218.   }
  1219.  
  1220.   this.mText              = ParamText;
  1221.   this.mBookLinks         = null;
  1222.   this.mChildren          = null;
  1223.   this.mChildrenSortArray = null;
  1224.  
  1225.   if (typeof(ParamSeeAlsoKey) == "string")
  1226.   {
  1227.     this.mSeeAlsoKey = ParamSeeAlsoKey;
  1228.   }
  1229.   if (typeof(ParamSeeAlsoGroupKey) == "string")
  1230.   {
  1231.     this.mSeeAlsoGroupKey = ParamSeeAlsoGroupKey;
  1232.   }
  1233.  
  1234.   this.fAddEntry  = WWHIndexEntry_AddEntry;
  1235.   this.fA         = WWHIndexEntry_AddEntry;
  1236.  
  1237.   // Bump entry count if not the top level node
  1238.   //
  1239.   if (ParamBookIndex != -1)
  1240.   {
  1241.     WWHFrame.WWHIndex.mEntryCount++;
  1242.   }
  1243.  
  1244.   // Add links
  1245.   //
  1246.   if ((typeof(ParamLinks) != "undefined") &&
  1247.       (ParamLinks != null))
  1248.   {
  1249.     this.mBookLinks = new WWHIndexEntryBookHash_Object();
  1250.     this.mBookLinks[ParamBookIndex] = ParamLinks;
  1251.   }
  1252. }
  1253.  
  1254. function  WWHIndexEntry_GetKey(ParamGroupTag,
  1255.                                ParamText,
  1256.                                ParamSort)
  1257. {
  1258.   var  VarKey = null;
  1259.  
  1260.  
  1261.   if ((typeof(ParamText) != "undefined") &&
  1262.       (ParamText != null) &&
  1263.       (ParamText.length > 0))
  1264.   {
  1265.     if ((typeof(ParamGroupTag) != "undefined") &&
  1266.         (ParamGroupTag != null) &&
  1267.         (ParamGroupTag.length > 0))
  1268.     {
  1269.       if (VarKey == null)
  1270.       {
  1271.         VarKey = "";
  1272.       }
  1273.  
  1274.       VarKey += ParamGroupTag;
  1275.     }
  1276.  
  1277.     if ((typeof(ParamSort) != "undefined") &&
  1278.         (ParamSort != null) &&
  1279.         (ParamSort.length > 0))
  1280.     {
  1281.       if (VarKey == null)
  1282.       {
  1283.         VarKey = "";
  1284.       }
  1285.  
  1286.       VarKey += ":" + ParamSort;
  1287.     }
  1288.  
  1289.     if (VarKey == null)
  1290.     {
  1291.       VarKey = "";
  1292.     }
  1293.  
  1294.     VarKey += ":" + ParamText;
  1295.   }
  1296.  
  1297.   return VarKey;
  1298. }
  1299.  
  1300. function  WWHIndexEntry_AddEntry(ParamText,
  1301.                                  ParamLinks,
  1302.                                  ParamSort,
  1303.                                  ParamGroupTag,
  1304.                                  ParamSeeAlso,
  1305.                                  ParamSeeAlsoSort,
  1306.                                  ParamSeeAlsoGroup,
  1307.                                  ParamSeeAlsoGroupSort,
  1308.                                  ParamSeeAlsoGroupTag)
  1309. {
  1310.   var  bVarGroupHeading;
  1311.   var  Links;
  1312.   var  VarKey;
  1313.   var  VarSeeAlsoKey;
  1314.   var  VarSeeAlsoGroupKey;
  1315.   var  BookIndex;
  1316.   var  ChildEntry;
  1317.   var  BookLinks;
  1318.   var  MaxIndex;
  1319.   var  Index;
  1320.  
  1321.  
  1322.   // See if this is a group heading
  1323.   //
  1324.   if ((typeof(ParamGroupTag) != "undefined") &&
  1325.       (ParamGroupTag != null) &&
  1326.       (ParamGroupTag.length > 0))
  1327.   {
  1328.     bVarGroupHeading = true;
  1329.   }
  1330.  
  1331.   // Set links if entries exist
  1332.   //
  1333.   if ((typeof(ParamLinks) != "undefined") &&
  1334.       (ParamLinks != null) &&
  1335.       (ParamLinks.length > 0))
  1336.   {
  1337.     Links = ParamLinks;
  1338.   }
  1339.   else
  1340.   {
  1341.     Links = null;
  1342.   }
  1343.  
  1344.   // See if this object has any children
  1345.   //
  1346.   if (this.mChildren == null)
  1347.   {
  1348.     this.mChildren = new WWHIndexEntryHash_Object();
  1349.   }
  1350.  
  1351.   // Define keys
  1352.   //
  1353.   VarKey             = WWHIndexEntry_GetKey(ParamGroupTag, ParamText, ParamSort);
  1354.   VarSeeAlsoKey      = WWHIndexEntry_GetKey(null, ParamSeeAlso, ParamSeeAlsoSort);
  1355.   VarSeeAlsoGroupKey = WWHIndexEntry_GetKey(ParamSeeAlsoGroupTag, ParamSeeAlsoGroup, ParamSeeAlsoGroupSort);
  1356.  
  1357.   // Access entry, creating it if it doesn't exist
  1358.   //
  1359.   BookIndex = WWHFrame.WWHIndex.mInitIndex;
  1360.   ChildEntry = this.mChildren[VarKey + "~"];
  1361.   if (typeof(ChildEntry) == "undefined")
  1362.   {
  1363.     ChildEntry = new WWHIndexEntry_Object(bVarGroupHeading, BookIndex, ParamText,
  1364.                                           Links, VarSeeAlsoKey, VarSeeAlsoGroupKey);
  1365.     this.mChildren[VarKey + "~"] = ChildEntry;
  1366.  
  1367.     // Add entry to see also collection if it is a see also entry
  1368.     //
  1369.     if (typeof(VarSeeAlsoKey) == "string")
  1370.     {
  1371.       WWHFrame.WWHIndex.fAddSeeAlsoEntry(ChildEntry);
  1372.     }
  1373.   }
  1374.   else  // Child entry exists, update with new information
  1375.   {
  1376.     // Add book links
  1377.     //
  1378.     if (Links != null)
  1379.     {
  1380.       if (ChildEntry.mBookLinks == null)
  1381.       {
  1382.         ChildEntry.mBookLinks = new WWHIndexEntryBookHash_Object();
  1383.       }
  1384.  
  1385.       if (typeof(ChildEntry.mBookLinks[BookIndex]) == "undefined")
  1386.       {
  1387.         ChildEntry.mBookLinks[BookIndex] = Links;
  1388.       }
  1389.       else
  1390.       {
  1391.         // Append new links
  1392.         //
  1393.         BookLinks = ChildEntry.mBookLinks[BookIndex];
  1394.         for (MaxIndex = Links.length, Index = 0 ; Index < MaxIndex ; Index++)
  1395.         {
  1396.           BookLinks[BookLinks.length] = Links[Index];
  1397.         }
  1398.       }
  1399.     }
  1400.   }
  1401.  
  1402.   return ChildEntry;
  1403. }
  1404.  
  1405. function  WWHIndexEntry_SortChildren(ParamEntry)
  1406. {
  1407.   var  UnsortedArray;
  1408.   var  KeyHash = new Object();
  1409.   var  SortedArray;
  1410.   var  VarKey;
  1411.   var  VarKeyUpperCase;
  1412.   var  MaxIndex;
  1413.   var  Index;
  1414.  
  1415.  
  1416.   // Accumulate hash keys
  1417.   //
  1418.   UnsortedArray = new Array();
  1419.   for (VarKey in ParamEntry.mChildren)
  1420.   {
  1421.     VarKeyUpperCase = VarKey.toUpperCase();
  1422.  
  1423.     UnsortedArray[UnsortedArray.length] = VarKeyUpperCase;
  1424.     if (VarKeyUpperCase != VarKey)
  1425.     {
  1426.       KeyHash[VarKeyUpperCase] = VarKey;
  1427.     }
  1428.   }
  1429.  
  1430.   // Insure array exists
  1431.   //
  1432.   if (UnsortedArray.length > 0)
  1433.   {
  1434.     // Sort array
  1435.     //
  1436.     SortedArray = UnsortedArray.sort();
  1437.  
  1438.     // Replace sort keys with entries
  1439.     //
  1440.     for (MaxIndex = SortedArray.length, Index = 0 ; Index < MaxIndex ; Index++)
  1441.     {
  1442.       VarKey = SortedArray[Index];
  1443.       if ((typeof(KeyHash[VarKey]) != "undefined") &&
  1444.           (KeyHash[VarKey] != null))
  1445.       {
  1446.         VarKey = KeyHash[VarKey];
  1447.       }
  1448.       SortedArray[Index] = ParamEntry.mChildren[VarKey];
  1449.     }
  1450.   }
  1451.   else
  1452.   {
  1453.     // No children, possible error occurred?
  1454.     //
  1455.     SortedArray = new Array();
  1456.   }
  1457.  
  1458.   // Set children sort array
  1459.   // Clear hash table as it is no longer needed
  1460.   //
  1461.   ParamEntry.mChildrenSortArray = SortedArray;
  1462.   ParamEntry.mChildren = null;
  1463. }
  1464.  
  1465. function  WWHIndexEntryHash_Object()
  1466. {
  1467. }
  1468.  
  1469. function  WWHIndexEntryBookHash_Object()
  1470. {
  1471. }
  1472.  
  1473. function  WWHSectionCache_Object()
  1474. {
  1475. }
  1476.  
  1477. function  WWHIndexOptions_Object()
  1478. {
  1479.   this.mThreshold     = 0;
  1480.  
  1481.   this.fSetThreshold = WWHIndexOptions_SetThreshold;
  1482.   this.fSetSeperator = WWHIndexOptions_SetSeperator;
  1483. }
  1484.  
  1485. function  WWHIndexOptions_SetThreshold(ParamThreshold)
  1486. {
  1487.   this.mThreshold = ParamThreshold;
  1488. }
  1489.  
  1490. function  WWHIndexOptions_SetSeperator(ParamSeperator)
  1491. {
  1492.   this.mSeperator = ParamSeperator;
  1493. }
  1494.